object OperatorDemo {
  def main(args: Array[String]): Unit = {
    //将数组中的偶数加倍，奇数丢弃.
    val array = (1 to 10).toArray
    val array1 = for (arr <- array if arr % 2 == 0) yield arr * 2

    //高阶函数实现
    array.filter(_ % 2 == 0).map(_ * 2).foreach(println(_))



  }

}

class Person{

}
